﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SystemSetManager.aspx.cs"
    Inherits="ZLDC.Estate.TM.SystemSetManager" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>系统设置</title>
    <link href="../css/main.css" rel="stylesheet" type="text/css" />
    <link href="../js/jquery/style/jquery.hiAlerts.css" rel="stylesheet" type="text/css" />
</head>
<body>

    <form id="form1" action="../Handler/HandlerSystem.ashx?act=systemoption_save" enctype="multipart/form-data"
    method="post">
    <div class="f_l rqieh" id="div_tab">
        <a class="y" style="cursor: pointer;" onclick="go_to(1);">基本设置</a> 
        <a style="cursor: pointer;" onclick="go_to(2);">必填项</a> 
        <a style="cursor: pointer;" onclick="go_to(3);">盘客源</a>
    </div>
    <div id="div1" class="page f_l">
    </div>
    <div style="width: 550px; padding-top: 15px; cursor: pointer; text-align: center;">        
        <input id="btnOk" class="button_bak" type="button" value="确定" onclick="submitOK()" /> 
    </div>
    <input id="hTypeID" name="hTypeID" value="1" type="hidden" />
    </form>

    <script src="../js/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>

    <script src="../js/jquery/jquery.hiAlerts-min.js" type="text/javascript"></script>

    <script src="../js/LexunJS.js" type="text/javascript"></script>

    <script type="text/javascript" language="javascript">

        $(document).ready(function() {
            showList(1);
        });

        // 列表数据 typeid=1 基本设置 2必填项设置 3盘客源设置
        function showList(typeid) {
            $("#hTypeID").val(typeid);
            
            $("#divList").html("<img src=\"../images/loading.gif\" />"); // 清空列表 
            $.ajax({
                type: 'POST',
                url: '../Handler/HandlerSystem.ashx',
                data: 'act=systemoption_list&typeid=' + typeid,
                timeout: '10000',
                error: function() {
                    alert("系统繁忙,请稍候后试！");
                }, success: function(json) {
                    showListCallBack(json);
                }
            });
        }

        function showListCallBack(response) {
            var json = eval("(" + response + ")");
            var record = json.record;

            var arr = [];
            arr.push("<table width=\"98%\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"#CCCCCC\">");

            var recordLength = record.length;
            for (var i = 0; i < recordLength; i++) {
                arr.push("<tr>");
                arr.push("<td width=\"25%\" align=\"right\" bgcolor=\"#F7F7F7\">");
                arr.push(record[i].item);
                arr.push("</td>");
                arr.push("<td width=\"20%\" bgcolor=\"#FFFFFF\" style=\"padding-left: 10px;\">");
                arr.push("<input id='itemvalue_" + record[i].id + "' name='itemvalue_" + record[i].id + "' type=\"text\" value='" + record[i].itemvalue + "' class=\"textdocdown\" style=\"width: 40%\" />");
                arr.push("</td>");
                arr.push("<td bgcolor=\"#FFFFFF\" style=\"padding-left: 10px;\">");
                arr.push("<input id='iRemark_" + record[i].id + "' name='iRemark_" + record[i].id + "' type=\"text\" value='" + record[i].remark + "' class=\"textdocdown\" style=\"width: 80%\" />");
                arr.push("</td>");
                arr.push("</tr>");
            }
            arr.push("</table>");

            $("#div1").html(arr.join('')); // 显示列表
        }

        // 跳转 num(跳到第几个标签)
        function go_to(num) {
            var tabs = document.getElementById("div_tab").getElementsByTagName("a");

            for (var i = 1; i <= tabs.length; i++) {
                if (num == i) {
                    tabs[i - 1].className = "y";                   
                } else {
                    tabs[i - 1].className = "";                    
                }
            }
                         
            showList(num); 
        }

        // 提交前验证
        function submitOK() {
            document.forms[0].submit();
        }
        
    </script>

</body>
</html>
